﻿using Builder;

static void Usage()
{
    Console.WriteLine("Usage: C# Program plain      编写纯文本文档");
    Console.WriteLine("Usage: C# Program html       编写HTML文档");
}

if (args.Length != 1 || (args[0] != "plain" && args[0] != "html"))
{
    Usage();
    return;
}

if (args[0] == "plain")
{
    var textBuilder = new TextBuilder();
    var director = new Director(textBuilder);
    director.Construct();
    var result = textBuilder.GetResult();
    Console.WriteLine(result);
}
else if (args[0] == "html")
{
    var htmlBuilder = new HTMLBuilder();
    var director = new Director(htmlBuilder);
    director.Construct();
    var result = htmlBuilder.GetResult();
    Console.WriteLine(result);
}